package com.ruoyi.stock.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.stock.mapper.StockBannerMapper;
import com.ruoyi.stock.domain.StockBanner;
import com.ruoyi.stock.service.IStockBannerService;

/**
 * banner图片Service业务层处理
 * 
 * @author xxb
 * @date 2024-12-30
 */
@Service
public class StockBannerServiceImpl implements IStockBannerService 
{
    @Autowired
    private StockBannerMapper stockBannerMapper;

    /**
     * 查询banner图片
     * 
     * @param id banner图片主键
     * @return banner图片
     */
    @Override
    public StockBanner selectStockBannerById(Long id)
    {
        return stockBannerMapper.selectStockBannerById(id);
    }

    /**
     * 查询banner图片列表
     * 
     * @param stockBanner banner图片
     * @return banner图片
     */
    @Override
    public List<StockBanner> selectStockBannerList(StockBanner stockBanner)
    {
        return stockBannerMapper.selectStockBannerList(stockBanner);
    }

    /**
     * 新增banner图片
     * 
     * @param stockBanner banner图片
     * @return 结果
     */
    @Override
    public int insertStockBanner(StockBanner stockBanner)
    {
        stockBanner.setCreateTime(DateUtils.getNowDate());
        return stockBannerMapper.insertStockBanner(stockBanner);
    }

    /**
     * 修改banner图片
     * 
     * @param stockBanner banner图片
     * @return 结果
     */
    @Override
    public int updateStockBanner(StockBanner stockBanner)
    {
        stockBanner.setUpdateTime(DateUtils.getNowDate());
        return stockBannerMapper.updateStockBanner(stockBanner);
    }

    /**
     * 批量删除banner图片
     * 
     * @param ids 需要删除的banner图片主键
     * @return 结果
     */
    @Override
    public int deleteStockBannerByIds(Long[] ids)
    {
        return stockBannerMapper.deleteStockBannerByIds(ids);
    }

    /**
     * 删除banner图片信息
     * 
     * @param id banner图片主键
     * @return 结果
     */
    @Override
    public int deleteStockBannerById(Long id)
    {
        return stockBannerMapper.deleteStockBannerById(id);
    }
}
